#include"string.h"

namespace str
{
	void test1()
	{
		string s1;
		string s2("ssssss");
		string s3(s2);
		s1 = s2;
		s1 = s1;
		cout << s2.c_str() << '\n';
		cout << s3.c_str() << '\n';
		cout << s1.c_str() << '\n';
	}

	void test2()
	{
		string s1("hello world!");
		for (int i = 0; i < s1.size(); i++)
		{
			cout << (char)(s1[i] + 1) << ' ';
		}
	}

	void test3()
	{
		string s1("hello world!");

		for (auto s : s1)
		{
			cout << s;
		}
	}

	void test4()
	{
		string s1("hello world!");

		s1.push_back('s');
		s1 += 's';
		s1 += "\nhhhkkkkkkkhhhkkkkkkkhhhkkkkkkkhhhkkkkkkkhhhkkkkkkkhhhkkkkkkk";
		for (auto s : s1)
		{
			cout << s;
		}
	}

	void test5()
	{
		string s1("hello world!");

		s1.insert(1, "sss");
		for (auto s : s1)
		{
			cout << s;
		}
		cout << '\n';
		s1.erase(1, 16);
		for (auto s : s1)
		{
			cout << s;
		}
	}

	void test6()
	{
		string s1("hello world!");
		
		s1.find('w');
		string sub = s1.substr(1);
		cout << sub.c_str();
	}
	void test7()
	{
		string s1;
		string s2("ssssss");
		string s3(s2);
		s1 = s2;
		s1 = s1;
		cout << (s1 == s2) << endl;
		cout << ("sssss" == s2) << endl;
		cout << (s1 == s2) << endl;
		cin >> s1;
		cout << s1;
	}
}

int main()
{
	str::test7();
	return 0;
}

